package com.vijay.compile.aspectj;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class MyServiceAspect {

    @Pointcut("execution(* com.vijay.compile.aspectj.MyService.run(..))")
    public void pointcut() {
    }


    @Around("pointcut()")
    public void aroundAdvice(ProceedingJoinPoint jp) throws Throwable {

        System.out.println("Before.....");
        Object result = jp.proceed();
        System.out.println("Return ....."+result);
        System.out.println("After.....");

    }

}
